// QuadraticFunction.h
// QuadraticFunction class definition. This file presents QuadraticFunction's public interface
// without revealing the implementations of QuadraticFunction's member functions which are
// defined in QuadraticFunction.cpp (except displayFunction for demonstration purposes)
#include <iostream> // allows program to perform input and output
#include <string>
// QuadraticFunction class definition
class QuadraticFunction
{
public:
	QuadraticFunction( double, double, double ); // constructor initializes the constants
	void setConstants( double, double, double ); // function that sets the constants
	double computeDiscriminant(); // function that computes the Discriminant
	void computeOnlyOneSolution(); // function that computes the only 1 solution
	void computeQuadraticFormula(); // function that computes the 2 real solutions
        void computeComplexSolution();// function that computes the 2 complex solutions
	void determineSolution(); // function that determines the solution type
	void createTableXY(); // function that creates an XY table of the function
        void computeYIntercept();/// function that computes y intercept

	// function that displays the Quadratic Function entered by the user
	void displayFunction()
	{
		std::cout << "The "<< equationType<< " Function you entered is:   y = ";
                if (equationType=="Quadratic")
                {std::cout << A << "x*x + " << B << "x + " << C << std::endl << std::endl;}
                if (equationType=="Linear")
                {std::cout <<  B << "x + " << C << std::endl << std::endl;}
                if (equationType=="Constant")
                {std::cout <<  C << std::endl << std::endl;}
		
	} // end displayFunction
        std::string equationType;
private:
        
	double A; // constant value of quadratic term for this QuadraticFunction
	double B; // constant value of linear term for this QuadraticFunction
	double C; // constant value of constant term for this QuadraticFunction
}; // end class QuadraticFunction